﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp.多播委托
{
    public class Cat
    {
        /// <summary>
        /// 猫叫了
        /// </summary>
        public void Meow()
        {
            Console.WriteLine("猫叫了");
        }

        #region 多播委托用到的
        public Action catAction = null;

        public void CatActionMethod()
        {
            Console.WriteLine("开始蝴蝶效应了");
            if (catAction != null)
            {
                catAction.Invoke();
            }
        }
        #endregion
    } 
}
